home *** CD-ROM | disk | FTP | other *** search
- -- stack: in
- -- format: 8 (HyperCard 1)
- -- flags: 0x0 (none)
- -- protect password hash: 0
- -- maximum user level: 5 (scripting)
- -- window: Rect(x1=0, y1=0, x2=0, y2=0)
- -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
- -- card dimensions: w=0 h=0
- -- scroll: x=0 y=0
- -- background count: 1
- -- first background id: 2593
- -- card count: 2
- -- first card id: 3290
- -- list block id: 2134
- -- print block id: 3429
- -- font table block id: 0
- -- style table block id: 0
- -- free block count: 5
- -- free size: 30848 bytes
- -- total size: 90112 bytes
- -- stack block size: 13824 bytes
- -- created by hypercard version: 0x00000000
- -- compacted by hypercard version: 0x00000000
- -- modified by hypercard version: 0x00000000
- -- opened by hypercard version: 0x00000000
- -- patterns[0]: 0x0000000000000000
- -- patterns[1]: 0x0000220000002200
- -- patterns[2]: 0x8800220088002200
- -- patterns[3]: 0xCC003300CC003300
- -- patterns[4]: 0xCC883322CC883322
- -- patterns[5]: 0xEE88BB22EE88BB22
- -- patterns[6]: 0xEECCBB33EECCBB33
- -- patterns[7]: 0xFFCCFF33FFCCFF33
- -- patterns[8]: 0xFFEEFFBBFFEEFFBB
- -- patterns[9]: 0xFFFFFFBBFFFFFFBB
- -- patterns[10]: 0x8010022001084004
- -- patterns[11]: 0xFFFFFFFFFFFFFFFF
- -- patterns[12]: 0x8822882288228822
- -- patterns[13]: 0x1122448811224488
- -- patterns[14]: 0xC4800C6843023026
- -- patterns[15]: 0xB130031BD8C00C8D
- -- patterns[16]: 0xAA00AA00AA00AA00
- -- patterns[17]: 0x8822552288225522
- -- patterns[18]: 0x8855225588552255
- -- patterns[19]: 0x77DD77DD77DD77DD
- -- patterns[20]: 0x8000000000000000
- -- patterns[21]: 0xAA55AA55AA55AA55
- -- patterns[22]: 0x038448300C020101
- -- patterns[23]: 0x8244394482010101
- -- patterns[24]: 0x8814224188412214
- -- patterns[25]: 0x8080413E080814E3
- -- patterns[26]: 0x22048C7422179810
- -- patterns[27]: 0xBE808808EB088880
- -- patterns[28]: 0x25C8328964244C92
- -- patterns[29]: 0xA29C41BE2AC914EB
- -- patterns[30]: 0x40A00000040A0000
- -- patterns[31]: 0x8040200002040800
- -- patterns[32]: 0xAA00800088008000
- -- patterns[33]: 0xFF80808080808080
- -- patterns[34]: 0x081C22C180010204
- -- patterns[35]: 0xFF808080FF080808
- -- patterns[36]: 0xF87422478F172271
- -- patterns[37]: 0xBF00BFBFB0B0B0B0
- -- patterns[38]: 0xFF7FBE5DA2418000
- -- patterns[39]: 0xFAF5FAF5A050A050
- -- checksum: 0x0
- ----- HyperTalk script -----
- ---------------------- Open Stack‚Ñ¢ Copyright 1987-----------------------
- ---------------------- by the Walking Shadow Press ---------------------
- on startUp
- getHomeInfo
- global fieldScript,fieldList,bookNumber,autoNumbering
- global tentativeBook, initGlobals
- ------------------------------------------------------------------
- -- fieldScript is a global which contains the script that is --
- -- automatically loaded into each newly created field. --
- -- The field must be named at the time of creation in order --
- -- for fieldScript to be loaded into its script. Otherwise, --
- -- errors result. --
- -- --
- -- --
- -- The following put commands put the generic field script --
- -- into global fieldScript. --
- ------------------------------------------------------------------
- put empty into fieldScript
- put "on closeField" into line 1 of fieldScript
- put "global fieldList" into line 2 of fieldScript
- put "put word 3 of name of me into tempName" into line 3 of fieldScript
- put "if not(fieldList contains tempName) then" into line 4 of fieldScript
- put "put (word 3 of name of me) & ""e&",""e&" after fieldList" into line 5 of fieldScript
- put "end if" into line 6 of fieldScript
- put "end closeField" into line 7 of fieldScript
-
- ---------------------------------------------------------------------
- -- fieldList is the global whick keeps track of which fields are --
- -- altered and need to be replicated each time a card is opened --
- -- and then closed. --
- ---------------------------------------------------------------------
- put empty into fieldList
- ---------------------------------------------------------------------
- -- tentativeBook is a global which records whether a new card is --
- -- being tentatively numbered, awaiting the entry of book data. --
- ---------------------------------------------------------------------
- put false into tentativeBook
-
- --------------------------------------------------------------------
- -- The automatic book numbering feature uses the globals: --
- -- autoNumbering and bookNumber to record whether autonumbering --
- -- is currently turned on and the next book number, respectively. --
- -- They must be initialized on startUp by going to the control --
- -- card and accessing the "Book Number" field and the --
- -- autoNumbering button. --
- --------------------------------------------------------------------
- set lockScreen to true
- push card
- put true into initGlobals
- go to stack "Control"
- put the hilite of button "Auto Numbering" into autoNumbering
- put card field "Book Number" into bookNumber
- ----------------------------------------------------------------
- -- initGlobals records whether the globals have already been --
- -- initialized or not. Otherwise, upon entry to the control --
- -- card, the "Book Number" field would be set to the current --
- -- value of global bookNumber, which is at first empty. --
- ----------------------------------------------------------------
- put false into initGlobals
- pop card
- set lockScreen to false
-
- pass startUp
- end startUp
-
- on openStack
- global beginGlobal
- -----------------------------------------------------------------
- -- This stack might be opened directly, which means that the --
- -- globals may not be initialized yet. beginGlobal will --
- -- always be false if the library system is up already. --
- -- Otherwise, a startUp message is send to initialize the --
- -- globals. --
- -----------------------------------------------------------------
- if beginGlobal is not false then
- put false into beginGlobal
- set cursor to 4
- startUp
- end if
- end openStack
-
- on quit
- global bookNumber
- -----------------------------------------------------------
- -- on quit we should save the bookNumber global so its --
- -- current value will be available upon startUp later. --
- -- bookNumber is saved in the "Book Number" field on the --
- -- conrtol card. --
- -----------------------------------------------------------
- set lockScreen to true
- push card
- go to stack "Control"
- put bookNumber into card field "Book Number"
- pop card
- set lockScreen to false
- end quit
-
- on mkNewCard
- global autoNumbering
- ---------------------------------------------------------------------
- -- This handler coordinates the creation of a new card set --
- -- record. It does so by going to each of the four main stacks: --
- -- Acquisition, Circulation, Catalog, and Label Setup and --
- -- making a new card on each. --
- -- At the same time the cards are made, their id numbers are --
- -- noted and from all four id numbers is created the card script --
- -- which controls the transfer to the related cards of each stack.--
- ---------------------------------------------------------------------
- set cursor to 4
- -- First, we create a new card in the current stack. --
- doMenu "New Card"
- set lockScreen to true
-
- -- We record the id of the newly created card in circId. --
- put the id of this card into circId
-
- -------------------------------------------------------------------
- -- Next, we create a segment of what will eventually be the --
- -- card script of each new card. The following segment will --
- -- handle transfers from other stacks to the card just created. --
- -------------------------------------------------------------------
- put "on goCirc" into line 1 of goCircScr
- put "go to "&circId&" of stack Circulation" into line 2 of goCircScr
- put "end goCirc" into line 3 of goCircScr
- ---------------------------------------------------------------------
- -- We push this card, 'cause we'll be coming back. See the second --
- -- to the last comment in this handler. --
- ---------------------------------------------------------------------
- push card
- ---------------------------------------------------------------------
- -- We next go to the Acquisition stack and do the same operations --
- -- as above, then go to the Catalog stack, and then the Label --
- -- Setup stack below... --
- ---------------------------------------------------------------------
- go to stack "Acquisitions"
- doMenu "New Card"
-
- put the id of this card into acqId
-
- put "on goAcq" into line 1 of goAcqScr
- put "go to "&acqId&" of stack Acquisitions" into line 2 of goAcqScr
- put "end goAcq" into line 3 of goAcqScr
- push card
- ------------------------------------------------------------------
- go to stack "Cataloging" -- See last comment.
- doMenu "New Card"
-
- put the id of this card into catId
-
- put "on goCat" into line 1 of goCatScr
- put "go to "&catId&" of stack Cataloging" into line 2 of goCatScr
- put "end goCat" into line 3 of goCatScr
- push card
- ------------------------------------------------------------------
- go to stack "Labels" -- See last big comment.
- doMenu "New Card"
-
- put the id of this card into labId
-
- put "on goLab" into line 1 of goLabScr
- put "go to "&labId&" of stack Labels" into line 2 of goLabScr
- put "end goLab" into line 3 of goLabScr
- ------------------------------------------------------------------
- -- Now, from all the card script segments created above, we --
- -- synthesize a big card script that will handle inter-stack --
- -- transfers. We combine all the segments into the variable --
- -- cardScr. --
- ------------------------------------------------------------------
- put goAcqScr into cardScr
- put goCircScr into line 4 of cardScr
- put goCatScr into line 7 of cardScr
- put goLabScr into line 10 of cardScr
-
- -------------------------------------------------------------------
- -- Finally, since we've been "pushing" cards as we went along, --
- -- all we do now is retrace our card steps by "popping" and --
- -- set the card scripts of each card we created to the --
- -- synthesized script. --
- -------------------------------------------------------------------
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
-
- --------------------------------------------------------------------
- -- Look at the openCard handler in the background script. You --
- -- will notice that the auto-numbering function is deactivated --
- -- if the card's script is emtpy. This is done to prevent --
- -- autonumbering while the cards are created. --
- -- Now, however, we want the auto-numbering function to work, --
- -- provided it's been turned on, so we send an openCard --
- -- message to the current card. --
- --------------------------------------------------------------------
- if autoNumbering is true then send openCard to this card
-
- set lockscreen to false
- end mkNewCard
-
- on delCard
- ---------------------------------------------------------------------
- -- This handler coordinates the deletion of card sets --
- -- It does so by going to each of the four main stacks: --
- -- Acquisition, Circulation, Catalog, and Label Setup and --
- -- deleting the right card in each. --
- -- To make sure the right card is deleted, we use the --
- -- go to command that appears in the card script, which is the --
- -- same command that normally transfers to other cards from --
- -- the current one. --
- ---------------------------------------------------------------------
- if the number of cards >1 then
- answer "Delete this and related cards in other stacks?" with "OK" or "Cancel"
- if it is not "Cancel" then
- set cursor to 4
- set lockScreen to true
-
- push card
- do line 2 of the script of this card -- go to Acquisition
- --------------------------------------------------------------
- -- Unfortunately, we cannot delete immediately, else --
- -- we lose our way to the other cards, so push this card... --
- --------------------------------------------------------------
- push card
- do line 8 of the script of this card -- go to Catalog
- push card -- Push the catalog card too.
- do line 11 of the script of this card -- go to Label SetUp
- --------------------------------------------------------------
- -- Now that we have all the related cards nicely lined --
- -- up in the card id stack, we just delete and pop, delete --
- -- and pop ... etc. --
- --------------------------------------------------------------
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
-
- set lockscreen to false
- end if
- else
- answer "The last card cannot be deleted."
- end if
- end delCard
-
- on arrowKey whichKey
- --------------------------------------------------------------
- -- If the keyboard has arrow, we make use of some to go to --
- -- next and previous cards... --
- --------------------------------------------------------------
- if the CommandKey is down then
- mkNewCard
- else
- if whichKey = "right" then
- go to next card
- else
- if whichKey = "left" then
- go to prev card
- end if
- end if
- end if
- end arrowKey
-
- -------------------- End Walking Shadow Library ---------------------
-
- on resume
- getHomeInfo
- pass resume
- end resume
-
- on getHomeInfo
- global stacks,applications,documents,userName
- set lockScreen to true
- set lockMessages to true
- push this card
- go to card "User Preferences" of stack "Home"
- put card field "User Name" into userName
- set userLevel to card field "User Level"
- set powerKeys to the hilite of button "Power Keys"
- set blindTyping to the hilite of button "Blind Typing"
- put field "paths" of card "stacks" into stacks
- put field "paths" of card "applications" into applications
- put field "paths" of card "documents" into documents
- pop card
- set lockScreen to false
- set lockMessages to false
- end getHomeInfo
-
-